from starlette.applications import Starlette
import core.enterprise_authorize
import core.enterprise_agent
import request_method as methods
import wxpublic
from wxpublic import PubPendingProSupSta, PubPendingProSupType, PubPendingProDet, PubBureauWeeklyRepSum, \
    PubBureauMonRepSum, PubStationWeeklyRep, PubStationMonRep, PubBureauWeeklyRep, PubBureauMonRep, \
    PubPowerSupplyStationList, PubPendingProRep, PubEquipVenderProRep, PubDepWorkloadRep, PubSuperviseConfirmStation, \
    PubSuperviseRecordSelect, PubReadStatusCheck,PubPhotoIndex

control = Starlette()
# 待处理问题汇总表（按供电所）局长、班长、主任、供电所长
control.add_route("/pub/ppss", wxpublic.PubPendingProSupSta.PendingProSupSta, methods=methods.get)
control.add_route("/pub/ppss/all", wxpublic.PubPendingProSupSta.PendingProSupStaAll, methods=methods.put)
control.add_route("/pub/ppss/single", wxpublic.PubPendingProSupSta.PendingProSupStaSingle, methods=methods.put)
# 待处理问题汇总表（按故障分类）
control.add_route("/pub/ppst", wxpublic.PubPendingProSupType.PendingProSupType, methods=methods.get)
control.add_route("/pub/ppst/detail", wxpublic.PubPendingProSupType.PendingProSupTypeDetail, methods=methods.get)
# 待处理问题明细表（督办）
control.add_route("/pub/ppd", wxpublic.PubPendingProDet.PendingProDet, methods=methods.get)
# 工作总结周报填报
control.add_route("/pub/bwrs", wxpublic.PubBureauWeeklyRepSum.BureauWeeklyRepSum, methods=methods.get)
# 工作总结月报填报
control.add_route("/pub/bwms", wxpublic.PubBureauMonRepSum.BureauMonRepSum, methods=methods.get)
# 供电所指标排名周报
control.add_route("/pub/swr", wxpublic.PubStationWeeklyRep.StationWeeklyRep, methods=methods.get)
# 供电所指标排名月报
control.add_route("/pub/smr", wxpublic.PubStationMonRep.StationMonRep, methods=methods.get)
# 供电局指标排名周报
control.add_route("/pub/bwr", wxpublic.PubBureauWeeklyRep.BureauWeeklyRep, methods=methods.get)
# 供电局指标排名月报
control.add_route("/pub/bmr", wxpublic.PubBureauMonRep.BureauMonRep, methods=methods.get)
# 县局对照表
# control.add_route("/pub/psbl", PowerSupplyBureauList.PowerSupplyBureauList, methods=methods.get)
# control.add_route("/pub/psbl/all", PowerSupplyBureauList.PowerSupplyBureauListAll, methods=methods.get)
# 供电所对照表
control.add_route("/pub/pssl/all", PubPowerSupplyStationList.PowerSupplyStationListAll, methods=methods.get)
control.add_route("/pub/pssl/single", PubPowerSupplyStationList.PowerSupplyStationListSingle, methods=methods.get)
# 问题对照表
# control.add_route("/pub/ptl", ProblemTypeList.ProblemTypeList, methods=methods.get)
# # 解决方法对照表
# control.add_route("/pub/rl", ResolventList.ResolventList, methods=methods.get)
# # 设备厂家对照表
# control.add_route("/pub/evl", EquipmentVenderList.EquipmentVenderList, methods=methods.get)
# # 公司操作员对照表
# control.add_route("/pub/co", CompanyOperator.CompanyOperatorControl, methods=methods.common)
# # 县局操作员对照表
# control.add_route("/pub/psbo", PubPowerSupplyBureauOperator.PowerSupplyBureauOperator, methods=methods.get)
# # 项目部县局对照表
# control.add_route("/pub/dvb", DepartmentVsBureau.DepartmentVsBureauControl, methods=methods.common)
# control.add_route("/pub/dvb", DepartmentVsBureau.DepartmentVsBureauControl, methods=methods.put)

# 待处理问题统计表
control.add_route("/pub/ppr", PubPendingProRep.PendingProRep, methods=methods.get)
control.add_route("/pub/ppr/detail", PubPendingProRep.PendingProRepDetail, methods=methods.get)

# #厂家问题分类统计表
control.add_route("/pub/evpr", PubEquipVenderProRep.EquipVenderProRep, methods=methods.get)
control.add_route("/pub/evpr/pro", PubEquipVenderProRep.EquipVenderProRepDetail, methods=methods.get)

# 项目部工作量统计
control.add_route("/pub/dwr", PubDepWorkloadRep.DepWorkloadRep, methods=methods.get)
control.add_route("/pub/dwr/detail", PubDepWorkloadRep.DepWorkloadRepDetail, methods=methods.get)

# 项目部工作量统计按供电所分类
control.add_route("/pub/dwrs", PubDepWorkloadRep.DepWorkloadRepStation, methods=methods.get)
control.add_route("/pub/dwrs/detail", PubDepWorkloadRep.DepWorkloadRepStationDetail, methods=methods.get)

# 供电所督办反馈页面
control.add_route("/pub/sco", PubSuperviseConfirmStation.SuperviseConfirmStation, methods=methods.get)
control.add_route("/pub/scd", PubSuperviseConfirmStation.SuperviseConfirmStationDetail, methods=methods.post)
control.add_route("/pub/scd", PubSuperviseConfirmStation.SuperviseConfirmStationDetail, methods=methods.get)
control.add_route("/pub/scsc", PubSuperviseConfirmStation.SuperviseConfirmStationCount, methods=methods.get)

# 供电所督办记录查询
control.add_route("/pub/srs", PubSuperviseRecordSelect.SuperviseRecordSelect, methods=methods.get)
control.add_route("/pub/srs/detail", PubSuperviseRecordSelect.SuperviseRecordDetail, methods=methods.get)
control.add_route("/pub/srs/assist", PubSuperviseRecordSelect.OperatorAssistRecord, methods=methods.get)


# 判断页面是否已阅读
control.add_route("/pub/rscs", PubReadStatusCheck.ReadStatusCheckSupervise, methods=methods.get)
control.add_route("/pub/rscw", PubReadStatusCheck.ReadStatusCheckWeekly, methods=methods.get)
control.add_route("/pub/rscm", PubReadStatusCheck.ReadStatusCheckMonth, methods=methods.get)
control.add_route("/pub/rscm", PubReadStatusCheck.ReadStatusCheckMonth, methods=methods.put)

# 图片索引表
control.add_route("/pub/pi", PubPhotoIndex.PhotoIndex, methods=methods.get)
# 图片预览
control.add_route("/pub/photo/preview/{fingerprint}", PubPhotoIndex.PhotoPreview, methods=methods.get)